package com.github.niefy.config;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
 * niefy
 * //@Configuration
 *
 * @author zchcpywin10
 */
@Slf4j
public class CorsConfig implements WebMvcConfigurer {
  @Override
  public void addCorsMappings(CorsRegistry registry) {
    log.info("应该没有用到!");
    registry
      //
      .addMapping("/**")
      //
      .allowedOrigins("*")
      //
      .allowCredentials(true)
      //
      .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS").maxAge(3600);
  }
}
